public class increasingTriplet {
    public boolean increasingTriplet(int[] nums) {
        int[] left = new int[nums.length];
        int[] right = new int[nums.length];
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        for(int i=0;i<nums.length;i++){
             left[i] = min;
             if(nums[i]<min){
                min = nums[i];
            }
        }
        for(int i = nums.length -1; i>=0;i--){
             right[i] = max;
             if(nums[i] > max){
                 max = nums[i];
             }
         }
         for(int i=0;i<nums.length;i++){
             if(left[i] < nums[i] && right[i]> nums[i]){
                 return true;
             }
         }
         return false;
    }
}
